feat(foundry-ignore-compile): read from ignore file and filter out al…#1
Open
tringuyenskymavis wants to merge 4 commits intofeature/foundry-ignore-compilefrom
Conversation
nxqbao
reviewed
Aug 1, 2024
crates/config/src/lib.rs
Outdated
| let foundry_ignored_paths: Vec<String> = self.get_ignore_paths()?; | ||
|
|
||
| if foundry_ignored_paths.is_empty() { | ||
| println!("No ignored paths found"); |
crates/config/src/lib.rs
Outdated
Comment on lines
838
to
851
| let foundry_ignored_paths: Vec<String> = self.get_ignore_paths()?; | ||
|
|
||
| if foundry_ignored_paths.is_empty() { | ||
| println!("No ignored paths found"); | ||
| } | ||
|
|
||
| let ignore_pattern: Vec<GlobMatcher> = foundry_ignored_paths | ||
| .iter() | ||
| .filter_map(|path| GlobMatcher::from_str(path).ok()) | ||
| .collect(); | ||
|
|
||
| let ignore_filter: SkipBuildFilters = | ||
| SkipBuildFilters::new(ignore_pattern.clone(), self.root.0.clone()); | ||
| builder = builder.sparse_output(ignore_filter); |
crates/config/src/lib.rs
Outdated
| let foundry_ignored_paths: Vec<String> = self.get_ignore_paths()?; | ||
|
|
||
| if foundry_ignored_paths.is_empty() { | ||
| println!("No ignored paths found"); |
There was a problem hiding this comment.
Suggested change
| println!("No ignored paths found"); | |
| println!("No skipped paths found in .foundryignore"); |
|
|
||
| let ignore_filter: SkipBuildFilters = | ||
| SkipBuildFilters::new(ignore_pattern.clone(), self.root.0.clone()); | ||
| builder = builder.sparse_output(ignore_filter); |
There was a problem hiding this comment.
Suggested change
| builder = builder.sparse_output(ignore_filter); | |
| builder = builder.sparse_output(ignore_filter); |
crates/config/src/lib.rs
Outdated
Comment on lines
1084
to
1086
| if !path.exists() { | ||
| return Ok(Vec::new()); | ||
| } |
There was a problem hiding this comment.
Return more clear error, to differentiate "file not found", and "file not contains items"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a feature to allow ignoring all paths specified in the foundry_ignore file when running forge build.